package com.douban.app.control;

import com.douban.app.model.Song;
import com.douban.app.service.SongService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class SongTestControl {

    @Autowired
    private SongService service;

    @GetMapping("/adds")
    public Song add(Song song){
        Song song1 = new Song();
        song1.setId("1");
        service.add(song1);
        return song;
    }

    @GetMapping("/alls")
    public Song all(){
        return service.get("1");
    }
}
